page.tsx 571 B

12345678910111213141516171819
  1. import { fetchUserComments, fetchUserProfile } from '@/lib/api/account/profile';
  2. import UserCommentsList from '../../_component/UserCommentsList';
  3. type Props = {
  4. params: Promise<{ sid: string }>;
  5. };
  6. export default async function UserProfileCommentsPage({ params }: Props) {
  7. const { sid } = await params;
  8. const [profileRes, commentsRes] = await Promise.all([
  9. fetchUserProfile(sid),
  10. fetchUserComments(sid, 1, 20)
  11. ]);
  12. const list = commentsRes.data?.list ?? [];
  13. const author = profileRes.data ?? null;
  14. return <UserCommentsList list={list} author={author} />;
  15. }